package dhm.com.hpx;

public class MyThread implements Runnable{

    int i=0;

    @Override
    public void run() {
        synchronized (this){
            while (true){
                synchronized (this){
                        System.out.println(Thread.currentThread().getName()+"胡圆圆"+i);
                        i++;

                        if (i==40){
                            break;
                        }

                }
                try {
                    Thread.sleep(200);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }

        }

    }
}
